package pathFiles2md;

import java.io.IOException;

import jodd.buffer.FastCharBuffer;
import jodd.io.FileUtil;
import jodd.io.findfile.WildcardFindFile;

public class Files2Md {
	public static void main(String[] args) throws IOException {
		String dir = System.getProperty("user.dir");
		FastCharBuffer sb = new FastCharBuffer();
		new WildcardFindFile().recursive(true).includeDirs(true).searchPath(dir).forEach(f -> {
			String path = f.getAbsolutePath();
			if (path.indexOf(".git") > 1) {
				return;
			}
			path = path.split("collected")[1];
			System.out.println(path);
			sb.append("1. "+path+"\r");
		});
		FileUtil.writeString(dir+"/README.md", sb.toString());
	}
}
